Skip to content

docs(adr): ADR-0112 — one error-code vocabulary: SCREAMING_SNAKE + standard catalog + extension ledger (#3841) - #3967

Merged
os-zhuang merged 3 commits into
mainfrom
claude/error-code-vocabulary-mismatch-iscrkw
Jul 30, 2026
Merged

docs(adr): ADR-0112 — one error-code vocabulary: SCREAMING_SNAKE + standard catalog + extension ledger (#3841)#3967
os-zhuang merged 3 commits into
mainfrom
claude/error-code-vocabulary-mismatch-iscrkw

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Adds ADR-0112, settling the spec decision requested in #3841: the platform's error-code vocabulary.

ADR only — no code changes in this PR. Implementation follows in the three batches the ADR's Rollout section defines (batch 1: spec rename + ledger + schema tightening; batch 2: lowercase emitter sweep; batch 3: location convergence).

The decision (D1–D9)

  • D1/D2 Top-level error.code adopts SCREAMING_SNAKE; StandardErrorCode's 51 members are renamed in place (breaking, client updated in the same batch-1 PR).
  • D3/D4 Two-tier vocabulary: the closed standard catalog + registered service extension codes in an ADR-0060-style ledger; ApiErrorSchema.code stops being z.string() and becomes the generated union — conformance suites gain value assertions with no test edits.
  • D5 Recorded end-state: one location (error.code) for the semantic code; details.code / error.type retired as carriers in batch 3 (unblocks the service-storage success bodies are three shapes, none carrying success: true — the other half of #3675 #3689 sibling: error.code occupied by the HTTP status).
  • D6 Field-level codes (FieldErrorSchema.code) are explicitly a separate vocabulary — schema widened to stop lying, own follow-up issue.
  • D7 error-catalog.mdx becomes generated from spec.
  • D8 Deliberate, recorded deviation from Prime Directive Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3 (error codes are machine constants, not data values; lexical-category separation; genre + AI-prior alignment).
  • D9 Adjacent cleanups ride along: dedupe the second ErrorCategory/RetryStrategy pair exported from spec/integration/connector.zod.ts; fix the client's wrong-nesting read of category/retryable.

Why now

Every consumer that branches on error codes today lives in objectstack/objectui — the last window in which this rename is cheap. The #3687/#3837 conformance suites are already in place to enforce the outcome, and the error.code-occupied-by-status fix is blocked until a vocabulary exists to migrate to.

Review focus

  • The two-tier ledger design (D3) vs a single closed enum — the ADR argues the giant enum makes spec a bottleneck.
  • D6's temporary widening of FieldErrorSchema.code to z.string() — honesty now vs enum later.
  • The PD#3 deviation rationale (D8).

Closes nothing yet; #3841 stays open until batch 1 lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MaSQn77TT5fUgHK9CesaDK


Generated by Claude Code

…andard catalog + extension ledger (#3841)

Settles the spec decision in #3841: top-level error.code adopts
SCREAMING_SNAKE via a two-tier vocabulary (closed StandardErrorCode
catalog + ADR-0060-style registered extension ledger), ApiErrorSchema.code
stops being z.string(), error-catalog.mdx becomes generated, field-level
codes are explicitly split into their own follow-up decision, and the
deviation from Prime Directive #3 is recorded with rationale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MaSQn77TT5fUgHK9CesaDK
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 12:26am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Jul 30, 2026
…e Directive #3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MaSQn77TT5fUgHK9CesaDK
@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 00:36
@os-zhuang
os-zhuang merged commit 0e73f38 into main Jul 30, 2026
14 checks passed
@os-zhuang
os-zhuang deleted the claude/error-code-vocabulary-mismatch-iscrkw branch July 30, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants